from flask import Flask
from SpiderProject.ProxiesPool.ProxySave import Saver


app = Flask(__name__)
mysql = Saver()


@app.route('/random', methods=['GET', ])
def random():
    proxy = mysql.random_data()
    return proxy


@app.route('/count', methods=['GET', ])
def count():
    count = mysql.count()
    return count


@app.errorhandler(404)
def error():
    return '您访问的页面不存在!'